Skip to content

fix(desktop): refresh @ search when channel membership changes - #7191

Draft
loganj wants to merge 1 commit into
fix/mention-picker-stack-844abd33-1from
fix/mention-picker-stack-844abd33-2
Draft

fix(desktop): refresh @ search when channel membership changes#7191
loganj wants to merge 1 commit into
fix/mention-picker-stack-844abd33-1from
fix/mention-picker-stack-844abd33-2

Conversation

@loganj

@loganj loganj commented Sep 1, 2026

Copy link
Copy Markdown
Collaborator

🤖

Summary

Keeps the people and agents you can @ mention up to date as membership changes, without restarting or reopening anything.

  • Membership events refresh the shared directory. When someone is added to or removed from a channel — by you or anyone else — the directory behind @ search is marked stale immediately and refreshed, so the new member can be found with @ the next time you type it. Before, the list could stay stale until something else happened to reload it.
  • Bursts don't stampede. Several membership changes in quick succession coalesce into one refresh window instead of a pile-up of overlapping reads.
  • A stale read can't come back and win. A directory read already in flight when the membership change lands is cancelled, so an older result can never arrive late and overwrite the fresh one.
  • Switching communities starts clean. Queued refreshes are dropped when you switch community or signing identity, so work from the old community can't leak into the new one.

The refresh supplies up-to-date evidence for the picker only; it never grants permission or optimistically adds anyone to the list.

Part of eight mention-editor PRs: shared recovery prerequisite #7190 → {#7191#7192, #7196#7323#7197#7239#7240}. This PR builds on #7190 to preserve the baseline visible ambiguous-send failure behavior; membership freshness remains a separate feature unit.

Related issue

Continues the merged mention-editor work from #7124 (authorize remote mentions at publication) and #7128 (preserve spacing after multi-word mentions). No separate tracking issue for this slice.

Testing

  • New unit tests membershipDirectorySync.test.mjs cover immediate staleness, coalescing, duplicate-event suppression, cancellation of in-flight reads, and reset on community or signing-identity switch.
  • Rebased composition validation: TypeScript, whole-desktop Biome, repository file-size guard and E2E build pass. On the composed fix(desktop): show an agent in @ search after you add it to a channel #7192 tree, 88 focused scheduler/membership/send/helper tests and 11 accepted-write/roster edge probes pass; zero-retry browser checks pass for Create→Add→first @, baseline chat ambiguous-submit/error/draft/no-publication, and Welcome refreshed roster→preserved ambiguous negative→exact current starter sole-recipient completion. Unchanged freshness and restored Welcome source blobs were compared exactly with the prior reviewed source; no full-package rerun was needed for the mechanical replay. Exact published-head CI run 34262722726 completed successfully, including Desktop Core, all four smoke shards, relay-backed integration, and macOS/Windows builds. DCO, Semgrep and zizmor also pass. This is lane-local evidence, not a ready-to-merge or all-lanes-green claim.

@loganj loganj changed the title fix(desktop): refresh agent discovery on live membership events fix(desktop): refresh @ search when channel membership changes Sep 2, 2026
@loganj
loganj force-pushed the fix/mention-picker-stack-844abd33-2 branch 3 times, most recently from 9164074 to b411da5 Compare September 4, 2026 11:17
@loganj
loganj force-pushed the fix/mention-picker-stack-844abd33-2 branch from b411da5 to 4316a13 Compare September 8, 2026 17:26
@loganj
loganj changed the base branch from fix/mention-picker-stack-844abd33-1 to integration/mention-picker-stack-844abd33-base September 8, 2026 17:27
@loganj
loganj force-pushed the fix/mention-picker-stack-844abd33-2 branch 2 times, most recently from e647e70 to 96c6d9c Compare September 8, 2026 17:36
Co-authored-by: Larry <627498bd4bd1f281a16431e3c6cce3b5c25b6692798c78672298aefbf2f8f8b5@buzz.block.builderlab.xyz>
Signed-off-by: Logan Johnson <loganj@squareup.com>
@loganj
loganj force-pushed the fix/mention-picker-stack-844abd33-2 branch from 96c6d9c to ff2b68c Compare September 8, 2026 18:23
@loganj
loganj changed the base branch from integration/mention-picker-stack-844abd33-base to fix/mention-picker-stack-844abd33-1 September 8, 2026 18:23
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant